#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

const double EPS = 1E-6;

int main(int argc, char *argv[]) {
    setName("checker for 1772C");
    registerTestlibCmd(argc, argv);

    int T = inf.readInt();
    for(int cases = 1; cases <= T; cases ++) {
        int n = inf.readInt();
        vector<int> a(n);
        for(int i = 0; i < n; i ++)
            a[i] = inf.readInt();
        int stdans = ans.readInt();
        int x = ouf.readInt();
        if(stdans == -1) {
            if(x != -1)
                quitf(_wa, "Answer does not exist on case %d but participant gave one.", cases);
        }else{
            if(x < 0 || x > 1000000000) 
                quitf(_wa, "illegal x selected on case %d.", cases);
            for(int i = 0; i < n; i ++) {
                a[i] = abs(a[i] - x);
                if(i > 0 && a[i] < a[i - 1]) quitf(_wa, "array not sorted on case %d.", cases);
            }
        }
    }
    quitf(_ok, "ok %d cases.", T);
}
